package dao

// 这是 SmsHomeRecommendProduct 的全局公开dao对象，被service层调用!
var SmsHomeRecommendProductDao = smsHomeRecommendProductDao{}

// 这是 sms_home_recommend_product表 的实体类
type SmsHomeRecommendProduct struct {
	Id              int64  `json:"id" form:"id"` // 编号
	ProductId       int64  `json:"product_id" form:"product_id"`
	ProductName     string `json:"product_name" form:"product_name"`
	RecommendStatus int32  `json:"recommend_status" form:"recommend_status"`
	Sort            int32  `json:"sort" form:"sort"`
}

// 注意:这是 SmsHomeRecommendProduct 的私有dao对象，只能在dao层内使用!
type smsHomeRecommendProductDao struct {
	InsertTemplate        func(arg []SmsHomeRecommendProduct) (int64, error)
	Delete                func(ids []int) (int64, error)                      `args:"ids"`
	UpdateSort            func(id, sort int) (int64, error)                   `args:"id,sort"`
	UpdateRecommendStatus func(ids []int, recommendStatus int) (int64, error) `args:"ids,recommend_status"`
	List                  func(arg SmsHomeRecommendProductList) ([]SmsHomeRecommendProduct, error)
}

type SmsHomeRecommendProductReq struct {
	List []SmsHomeRecommendProduct `json:"list"`
}

type SmsHomeRecommendProductList struct {
	ProductName     string `json:"product_name" form:"product_name"`
	RecommendStatus int32  `json:"recommend_status" form:"recommend_status"`
	Page
}

type Page struct {
	PageNum  int `json:"page_num" form:"page_num"`
	PageSize int `json:"page_size" form:"page_size"`
}
